<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
        *{
            margin: 0;
        }
        .title{
            font-size: 2rem;
            text-align: center;
            font-weight: bold;
            margin-bottom: 1rem;
        }
        img{
            width: 100%;
            height: 100%;
            object-fit: contain;
        }
        .ctn{
            height: 100vh;
            overflow: scroll;
            display: flex;
            flex-flow: column;
            font-size: 1.8rem;
            margin: 1rem;
            margin-bottom: 0;
        }
        .box{
            padding: 1rem;
            border-bottom: 1px solid #dedede;
        }
        .a .tr{
            display: flex;
            justify-content: space-between;
            margin: 1.2rem 0;
        }
        .a .tr>div:nth-child(1){
            color: #999;
        }
        .b .tr{
            display: flex;
            flex-flow: column;
            margin: 1.8rem 0;
        }
        .b .tr>div:nth-child(1){
            font-weight: bold;
            color: #999;
            margin-bottom: .8rem;
        }
        .sign{
            text-align: right;
            padding: 2rem 0;
        }
        .imgarea{
            display: flex;
            flex-wrap: wrap;
        }
     
    </style>
    <title>急诊病历</title>
</head>
<body>
<div class="ctn">
    <div class="box a">
        <div class="title">个人资料</div>
        <div class="tr">
            <div>姓名：</div>
            <div>{{userinfo.name}}</div>
        </div>
        <div class="tr">
            <div>性别：</div>
            <div>{{userinfo.sex}}</div>
        </div>
        <div class="tr">
            <div>年龄：</div>
            <div>{{userinfo.age}}</div>
        </div>
        <div class="tr">
            <div>民族：</div>
            <div>{{userinfo.nation}}</div>
        </div>
        <div class="tr">
            <div>联系方式：</div>
            <div>{{userinfo.tel}}</div>
        </div>
    </div>
    <div class="box a" v-if="blzl != false">
        <div class="title">病历资料</div>
        <!-- <div class="imgarea"> -->
            <div class="imgbox" v-for="(i,index) in blzl" :key="index">
                <img :src="i.img" alt="">
            </div>
        <!-- </div> -->
    </div>
    <div class="box a" v-if="fzjc != false">
        <div class="title">辅助检查</div>
        <!-- <div class="imgarea"> -->
            <div class="imgbox" v-for="(i,index) in fzjc" :key="index">
                <img :src="i.img" alt="">
            </div>
        <!-- </div> -->
    </div>

</div>
</body>
<script src="__STATIC__/js/rem.js"></script>
<script src="__STATIC__/js/vue.min.js"></script>
<script src="__STATIC__/js/jquery.min.js"></script>
<script>
    var app = new Vue({
        el:'.ctn',
        data:{
            userinfo:{},
            blzl:[],
            fzjc:[]
        },
        created(){
            var query=this.$route.query;
            let lat = query.lat;
            console.log('query:',query,'lat:',lat)
            this.get()
        },
        methods: {
            get(){
                var that = this;
                $.ajax({
                    type: "get",
                    url: "https://sharehis.funcnum.com/user/emr/get",
                    data: {
                        field:'er_id',
                        op:'=',
                        value:5
                    },
                    dataType: "JSON",
                    success: function (res) {
                        console.log(res)
                        that.userinfo = res[0].user;
                        that.blzl = res[0].emr_img.filter(val => {
                            if(val.classify == 0){
                                return val
                            }
                        });
                        that.fzjc = res[0].emr_img.filter(val => {
                            if(val.classify == 1){
                                return val
                            }
                        });
                    }
                });
            }
        }
    })
</script>
</html>